from openai import OpenAI
from API_KEY import *

client = OpenAI(api_key=api_key_ds, base_url="https://api.deepseek.com")
MODEL = "deepseek-reasoner"


def chat(messages, model=MODEL):
    response = client.chat.completions.create(
        model=model,
        messages=messages
    )

    reasoning_content = response.choices[0].message.reasoning_content
    content = response.choices[0].message.content
    return reasoning_content, content


if __name__ == '__main__':
    q = input("用户:")
    messages = [{"role": "user", "content": q}]
    reasoning_content, content = chat(messages, MODEL)
    print(reasoning_content)
    print(content)

